//
// Created by Administrator on 2024/4/8.
// 埃氏筛法

#include <iostream>
using namespace std;

int main()
{
    int n = 100;
    n = 1152761; // out: 89503
//    n = 1740948; // out: 130971
//    n = 2795431; // out: 203047
//    cin>>n;
    bool p[n+1]={0};
    for (int i = 2; i <=n; ++i)
        p[i]=1;
    for (int i = 2; i*i <=n ; ++i)
    {
        if (p[i])
        {
            for (int j = i+i; j <=n ; j+=i)
            {
                p[j]=0;
            }
        }
    }
    int ret=0;
    for (int i = 0; i <=n; ++i)
    {
        if(p[i])
            ret++;
    }
    cout<<ret;
    return 0;
}